/*
 * Box.cpp
 *
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses 
 */

#include "Box.h"
#include "Properties.h"

using std::string;

Box::Box(int x, int y)
    : MapObject(x, y) {
    init();
}

Box::Box(int id, int x, int y)
    : MapObject(id, x, y) {
    init();
}

Box::Box(int x, int y, string typeXml)
    : MapObject(x, y, typeXml) {
    init();
}

Box::Box(int id, int x, int y, string typeXml)
    : MapObject(id, x, y, typeXml) {
    init();
}

void Box::init() {
    Properties properties = Properties();
    resistance = properties.getPropertyAsInt("box_resistance");
    points = properties.getPropertyAsInt("box_points");
}

Box* Box::clone() {
    return new Box(*this);
}

ModelObject Box::getRepresentation() {
    return BOX;
}
